<!--   [PAGE]] : 链数据详情
       @Author  : ljq
       @Created : 2025/10/14
 -->
<template>
 <div class="app-container">
 <!-- ------------------------ START: 查询框 -------------------------->
 <el-form class="query" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="链表#ID">
    <el-input  v-model="queryParams.chainId"  placeholder="请输入链表#ID"  clearable  @keyup.enter.native="handleQuery(form)"/>
  </el-form-item>
<el-form-item label="资产键">
    <el-input  v-model="queryParams.params.assetKeyLike"  placeholder="请输入资产键"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>
<el-form-item label="交易号">
    <el-input  v-model="queryParams.params.txIdLike"  placeholder="请输入交易号"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>
<el-form-item label="备注">
    <el-input  v-model="queryParams.params.commentLike"  placeholder="请输入备注"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>
<el-form-item label="附加内容">
    <el-input  v-model="queryParams.params.otherLike"  placeholder="请输入附加内容"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>
<el-form-item label="创建时间">
         <el-date-picker v-model="queryParams.params.createTimeRange"  style="width: 240px"  value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"/>
  </el-form-item>
<el-form-item label="更新时间">
         <el-date-picker v-model="queryParams.params.updateTimeRange"  style="width: 240px"  value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"/>
  </el-form-item>
<el-form-item label="创建者">
    <el-input  v-model="queryParams.params.createByLike"  placeholder="请输入创建者"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>
<el-form-item label="更新者">
    <el-input  v-model="queryParams.params.updateByLike"  placeholder="请输入更新者"  clearable  @keyup.enter.native="handleQuery"/>
  </el-form-item>

  <el-form-item class="option">
    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
    <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  </el-form-item>
</el-form>
<!-- ------------------------- END: 查询框 --------------------------->

<!-- ---------------------- START: 主数据区域------------------------->
<el-row :gutter="10" class="mb8">
  <el-col :span="1.5">
    <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="[`${permi}:add`]">新增</el-button>
  </el-col>
  <el-col :span="1.5">
    <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="[`${permi}:remove`]">删除</el-button>
  </el-col>
  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"/>
</el-row>


<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
    <el-table-column type="selection" width="50" align="center"/>
    <el-table-column label="编号" align="center" prop="id" v-if="columns[0].visible"/>
    <el-table-column label="链表#ID" align="center" prop="chainId" v-if="columns[1].visible"/>
    <el-table-column label="资产键" align="center" prop="assetKey" v-if="columns[2].visible"/>
    <el-table-column label="交易号" align="center" prop="txId" v-if="columns[3].visible"/>
    <el-table-column label="备注" align="center" prop="comment" v-if="columns[4].visible"/>
    <el-table-column label="附加内容" align="center" prop="other" v-if="columns[5].visible"/>
    <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible"/>
    <el-table-column label="创建者"   align="center" prop="createBy"   v-if="columns[7].visible"/>
    <el-table-column label="更新时间" align="center" prop="updateTime" v-if="columns[8].visible"/>
    <el-table-column label="更新者"   align="center" prop="updateBy"   v-if="columns[9].visible"/>
    <!-- 操作列 -->
    <operation-column :permi="permi" @edit="handleUpdate" @delete="handleDelete"/>
</el-table>

<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
<!-- ---------------------- END: 主数据区域 ------------------------>

<!-- ------------------------ START: 弹出框 -------------------------->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
  <el-form ref="form" :model="form" :rules="rules" label-width="80px">
    <el-row>
      <el-col :span="12">
      <el-form-item label="链表#ID" prop="chainId">
    <el-input v-model="form.chainId" placeholder="请输入链表#ID"/>
      </el-form-item>
      </el-col>
      <el-col :span="12">
      <el-form-item label="资产键" prop="assetKey">
    <el-input v-model="form.assetKey" placeholder="请输入资产键"/>
      </el-form-item>
      </el-col>
      <el-col :span="12">
      <el-form-item label="交易号" prop="txId">
    <el-input v-model="form.txId" placeholder="请输入交易号"/>
      </el-form-item>
      </el-col>
      <el-col :span="12">
      <el-form-item label="备注" prop="comment">
    <el-input v-model="form.comment" placeholder="请输入备注"/>
      </el-form-item>
      </el-col>
      <el-col :span="12">
      <el-form-item label="附加内容" prop="other">
    <el-input v-model="form.other" placeholder="请输入附加内容"/>
      </el-form-item>
      </el-col>
    </el-row>          
 </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button type="primary" @click="submitForm">确 定</el-button>
    <el-button @click="cancel">取 消</el-button>
  </div>
</el-dialog>
<!-- ------------------------ END: 弹出框 -------------------------->
</div>
</template>
<script>
import {listChainDetail, getChainDetail, addChainDetail, updateChainDetail, delChainDetail} from "@/api/business/chainDetail";
import {initData,  baseMethods} from "@/utils/basePage";


let baseData = initData();
baseData.baseTitle = "";
export default {
  name: "ChainDetail",
  dicts: [],
  components: { },
  data() {
    return {
      ...baseData,
      permi: 'business:xxx',
      // 列信息
      columns: [
        { key: 0, label: `编号`, visible: true },
        { key: 1, label: `链表#ID`, visible: true },
        { key: 2, label: `资产键`, visible: true },
        { key: 3, label: `交易号`, visible: true },
        { key: 4, label: `备注`, visible: true },
        { key: 5, label: `附加内容`, visible: true },
        { key: 6, label: `创建时间`, visible: true },
        { key: 7, label: `创建者`,   visible: false },
        { key: 8, label: `更新时间`, visible: false },
        { key: 9, label: `创建者`,   visible: false },
      ],
      // 表单校验
      rules:{
         chainId:[{ required: true, message: "链表#ID不能为空", trigger: "blur" }],
         assetKey:[{ required: true, message: "资产键不能为空", trigger: "blur" }],
         txId:[{ required: true, message: "交易号不能为空", trigger: "blur" }],
         createTime:[{ required: true, message: "创建时间不能为空", trigger: "blur" }],
         updateTime:[{ required: true, message: "更新时间不能为空", trigger: "blur" }],
         delFlag:[{ required: true, message: "删除标志不能为空", trigger: "blur" }],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    ...baseMethods(listChainDetail, getChainDetail, addChainDetail, updateChainDetail, delChainDetail),
  }
};
</script>